}
// starts from CA and goes down the presented chain
- auto verifier = asio::ssl::rfc2818_verification(hostname);
+ auto verifier = asio::ssl::host_name_verification(hostname);
bool verified = verifier(preverified, ctx);
auto verify_ec = X509_STORE_CTX_get_error(ctx.native_handle());
if (verify_ec != 0 /*X509_V_OK*/ and logger)
{
std::lock_guard<std::mutex> lock(mutex_);
if (!is_open()) {
- if (cb) ctx_.post([cb](){ cb(asio::error::broken_pipe, 0); });
+ if (cb) asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
return;
}
if (ssl_socket_) asio::async_write(*ssl_socket_, write_buf_, wrapCallback(std::move(cb)));
else if (socket_) asio::async_write(*socket_, write_buf_, wrapCallback(std::move(cb)));
- else if (cb) ctx_.post([cb](){ cb(asio::error::operation_aborted, 0); });
+ else if (cb) asio::post(ctx_, [cb](){ cb(asio::error::operation_aborted, 0); });
}
void
{
std::lock_guard<std::mutex> lock(mutex_);
if (!is_open()) {
- if (cb) ctx_.post([cb](){ cb(asio::error::broken_pipe, 0); });
+ asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
return;
}
if (ssl_socket_) asio::async_read_until(*ssl_socket_, read_buf_, delim, wrapCallback(std::move(cb)));
else if (socket_) asio::async_read_until(*socket_, read_buf_, delim, wrapCallback(std::move(cb)));
- else if (cb) ctx_.post([cb](){ cb(asio::error::operation_aborted, 0); });
+ else if (cb) asio::post(ctx_, [cb](){ cb(asio::error::operation_aborted, 0); });
}
void
{
std::lock_guard<std::mutex> lock(mutex_);
if (!is_open()) {
- if (cb) ctx_.post([cb](){ cb(asio::error::broken_pipe, 0); });
+ if (cb) asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
return;
}
if (ssl_socket_) asio::async_read_until(*ssl_socket_, read_buf_, delim, wrapCallback(std::move(cb)));
else if (socket_) asio::async_read_until(*socket_, read_buf_, delim, wrapCallback(std::move(cb)));
- else if (cb) ctx_.post([cb](){ cb(asio::error::operation_aborted, 0); });
+ else if (cb) asio::post(ctx_, [cb](){ cb(asio::error::operation_aborted, 0); });
}
void
{
std::lock_guard<std::mutex> lock(mutex_);
if (!is_open()) {
- if (cb) ctx_.post([cb](){ cb(asio::error::broken_pipe, 0); });
+ if (cb) asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
return;
}
if (ssl_socket_) asio::async_read(*ssl_socket_, read_buf_, asio::transfer_exactly(bytes), wrapCallback(std::move(cb)));
else if (socket_) asio::async_read(*socket_, read_buf_, asio::transfer_exactly(bytes), wrapCallback(std::move(cb)));
- else if (cb) ctx_.post([cb](){ cb(asio::error::operation_aborted, 0); });
+ else if (cb) asio::post(ctx_, [cb](){ cb(asio::error::operation_aborted, 0); });
}
void
{
std::lock_guard<std::mutex> lock(mutex_);
if (!is_open()) {
- if (cb) ctx_.post([cb](){ cb(asio::error::broken_pipe, 0); });
+ if (cb) asio::post(ctx_, [cb](){ cb(asio::error::broken_pipe, 0); });
return;
}
auto buf = read_buf_.prepare(bytes);
: logger_(logger)
, ioContext_(ioContext)
, sockFd_(*ioContext_, domain)
- , sockAddrSend_(asio::ip::address::from_string(domain.family() == AF_INET ? MULTICAST_ADDRESS_IPV4
+ , sockAddrSend_(asio::ip::make_address(domain.family() == AF_INET ? MULTICAST_ADDRESS_IPV4
: MULTICAST_ADDRESS_IPV6), port)
{
try {
callbackmap_[type] = callback;
if (not drunning_) {
drunning_ = true;
- ioContext_->post([this] () {
+ asio::post(*ioContext_, [this] () {
loopListener();
query(sockAddrSend_);
});
messages_[type] = std::move(pack_buf_c);
reloadMessages();
lrunning_ = true;
- ioContext_->post([this] () { publish(sockAddrSend_); });
+ asio::post(*ioContext_, [this] () { publish(sockAddrSend_); });
}
bool